package com.xoa.controller.trainingPlanRecord;

import com.xoa.model.trainingPlanRecord.EduTrainingRecordWithBLOBs;
import com.xoa.service.trainingPlanRecord.EduTrainingRecordService;
import com.xoa.util.AjaxJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 创建作者:   高亚峰
 * 创建日期:   2017/9/11 17:02
 * 类介绍  :   培训记录
 * 构造参数:
 */
@Controller
@RequestMapping("/record")
public class EduTrainPlainRecordController {

    @Autowired
  private EduTrainingRecordService eduTrainingRecordService;



  /**
   * 创建人：杨璞
   * 创建时间：2017-09-14
   * 方法说明：页面连接跳转
   * @return
   */
  @RequestMapping("/trainRecord")
  public  String  trainRecord(){
    return "app/train/eduTrainPlan/planRecordIndex";
  }


  /**
   * 创建人：高亚峰
   * 创建时间：2017-09-14
   * 方法说明：页面连接跳转
   * @return
   */
  @RequestMapping("/trainRecordMange")
  public  String  trainRecordMange(){
    return "app/train/eduTrainPlan/trainRecordMange";
  }

  /**
   * 创建人：高亚峰
   * 创建时间：2017-09-14
   * 方法说明：页面连接跳转
   * @return
   */
  @RequestMapping("/trainRecordNew")
  public  String  trainRecordNew(){
    return "app/train/eduTrainPlan/trainRecordNew";
  }

  /**
   * 创建人：高亚峰
   * 创建时间：2017-09-14
   * 方法说明：页面连接跳转
   * @return
   */
  @RequestMapping("/trainRecordQuery")
  public  String  trainRecordQuery(){
    return "app/train/eduTrainPlan/trainRecordQuery";
  }

  /**
   * 创建人：高亚峰
   * 创建时间：2017-09-14
   * 方法说明：页面详情
   * @return
   */
  @RequestMapping("/goDetail")
  public  String  goDetail(){
    return "app/train/eduTrainPlan/trainRecordDetail";
  }





    /**
     * 创建作者:   高亚峰
     * 创建日期:   2017/9/11 17:46
     * 类介绍  :   培训记录添加
     * 构造参数:   EduTrainingRecordWithBLOBs
     */
    @RequestMapping("/save")
    @ResponseBody
    public AjaxJson addEduTrainPlainRecord(HttpServletRequest request,EduTrainingRecordWithBLOBs eduTrainingRecordWithBLOBs){
       return eduTrainingRecordService.addEduTrainPlainRecord(request,eduTrainingRecordWithBLOBs);
    }
    /**
     * 创建作者:   高亚峰
     * 创建日期:   2017/9/11 17:46
     * 类介绍  :   培训记录编辑
     * 构造参数:   EduTrainingRecordWithBLOBs
     */
    @RequestMapping("/editRecord")
    @ResponseBody
    public AjaxJson editRecord(HttpServletRequest request, EduTrainingRecordWithBLOBs eduTrainingRecordWithBLOBs){
        return eduTrainingRecordService.editRecord(request,eduTrainingRecordWithBLOBs);
    }
    /**
     * 创建作者:   高亚峰
     * 创建日期:   2017/9/11 17:46
     * 类介绍  :   培训记录删除
     * 构造参数:   recordId
     */
    @RequestMapping("/delete")
    @ResponseBody
    public AjaxJson deleteRecordById(HttpServletRequest request,Integer recordId){
        return eduTrainingRecordService.deleteRecordById(request,recordId);
    }
    /**
     * 创建作者:   高亚峰
     * 创建日期:   2017/9/11 17:46
     * 类介绍  :   培训记录查询详情
     * 构造参数:   recordId
     */
    @RequestMapping("/getdetail")
    @ResponseBody
    public AjaxJson getdetail(HttpServletRequest request,Integer recordId){
        return eduTrainingRecordService.getdetail(request,recordId);
    }
    /**
     * 创建作者:   高亚峰
     * 创建日期:   2017/9/11 17:46
     * 类介绍  :   培训记录列表展示接口
     * 构造参数:   分页参数
     */
    @RequestMapping("/getAll")
    @ResponseBody
    public AjaxJson getAll(HttpServletRequest request,@RequestParam(value = "page",required = false) Integer page,
                           @RequestParam(value = "pageSize",required = false) Integer pageSize,
                           @RequestParam(value="useFlag",required = false) Boolean useFlag,String staffUserId){
        return eduTrainingRecordService.getAll(request,page,pageSize,useFlag,staffUserId);
    }
    /**
     * 创建作者:   高亚峰
     * 创建日期:   2017/9/11 17:53
     * 类介绍  :   培训记录查询
     * 构造参数:   EduTrainingRecordWithBLOBs
     */
    @RequestMapping("/query")
    @ResponseBody
    public AjaxJson queryRecord(EduTrainingRecordWithBLOBs eduTrainingRecordWithBLOBs,String export,HttpServletRequest request,HttpServletResponse response){
        return eduTrainingRecordService.queryRecord(eduTrainingRecordWithBLOBs,export,request,response);
    }
  /**
   * 创建作者:   高亚峰
   * 创建日期:   2017/9/11 17:46
   * 类介绍  :   批量删除培训记录删除
   * 构造参数:   recordId
   */
  @RequestMapping("/deleteByIds")
  @ResponseBody
  public AjaxJson deleteByIds(String []recordIds){
    return eduTrainingRecordService.deleteByIds(recordIds);
  }
    /**
     * 创建作者:   陈玲
     * 创建日期:   2018/7/27 17:46
     * 类介绍  :   查询培训计划的新建培训名称
     * 构造参数:
     */
    @RequestMapping("/FindAllsPlane")
    @ResponseBody
    public AjaxJson FindAllsPlane(){
        return eduTrainingRecordService.FindAllsPlane();
    }

}
